package com.shortlink.admin.dao.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.shortlink.common.base.BaseDO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDate;

/**
 * 短链接实体
 *
 * @author wp
 */
@TableName("t_shortlink")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ShortLinkDO extends BaseDO {
    public static final String ID_NAME = "id";
    public static final String GID_NAME = "gid";
    public static final String GROUP_NAME_NAME = "groupName";
    public static final String USER_ID_NAME = "user_id";
    /**
     * id
     */
    private Long id;
    /**
     * 用户ID
     */
    private Long userId;
    /**
     * 分组ID
     */
    private Long gid;
    /**
     * 分组名
     */
    private String groupName;
    /**
     * 域名
     */
    private String domain;
    /**
     * 短链接
     */
    private String shortUri;
    /**
     * 原始链接
     */
    private String originUrl;
    /**
     * 有效期
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private LocalDate validDate;
    /**
     * 描述
     */
    private String description;
    /**
     * 网站标识
     */
    private String favicon;
    /**
     * 历史PV
     */
    private Integer totalPv;
    /**
     * 历史UV
     */
    private Integer totalUv;
    /**
     * 历史IP
     */
    private Integer totalIp;
    /**
     * 删除标识 0：未删除 1：已删除
     */
    private Integer delFlag;
    /**
     * 删除时间
     */
    private Long delTime;
}